package com.fast.mybatis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;

import java.io.FileWriter;

@SpringBootApplication
public class FastMybatisApplication {

    public static void main(String[] args) {
        SpringApplication.run(FastMybatisApplication.class, args);

        /*final String TEMPLATE_PREFIX = "templates/";
        final String TEMPLATE_SUFFIX = ".html";

        try {
            ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();
            resolver.setPrefix(TEMPLATE_PREFIX);
            resolver.setSuffix(TEMPLATE_SUFFIX);
            TemplateEngine templateEngine = new TemplateEngine();
            templateEngine.setTemplateResolver(resolver);


            //填充数据
            Context context = new Context();
            context.setVariable("name", "俩快线-俩快线");
            //渲染模板生成静态
            FileWriter writer = new FileWriter("d:/likaixuan/index.html");
            templateEngine.process("indexTemplate", context, writer);
        } catch (Exception e) {
            System.out.println(e);
        }*/

    }
}
